<?php
/**
 * Free Uch
 *
 * @category   FreeUch
 * @copyright  Copyright 2009 lordharrdlee(http://www.lordharrdlee.cn)
 * @author     lordharrdlee<lordharrdlee@gmail.com>
 * @version    $Id: Base.php 10 2010-01-14 10:31:01Z lordharrdlee $
 */
/**
 * Model_Base
 * @author liyizhou<lordharrdlee@hotmail.com>
 */
abstract class Model_Base
{

    /**
     * @var Db_Manager $db
     */
    protected $db;

    protected function initDb()
    {
        if (empty($this->db)) {
            global $_SC;
            Loader::loadClass('Util_DBCommon');
            Loader::loadClass('Db_Factory');
            $this->db = Db_Factory::init($_SC);
        }
    }

    protected function setDb($db)
    {
        $this->db = $db;
    }

    protected function getDb()
    {
        return $this->db;
    }
}